package DP.chainOfResponsibility.women;

import DP.chainOfResponsibility.women.womenBean.IWomen;
import DP.chainOfResponsibility.women.womenBean.impl.Women;
import DP.chainOfResponsibility.women.handler.impl.Father;
import DP.chainOfResponsibility.women.handler.Handler;
import DP.chainOfResponsibility.women.handler.impl.Husband;
import DP.chainOfResponsibility.women.handler.impl.Son;

import java.util.ArrayList;
import java.util.Random;

/**
 * @author msi
 */
public class Client {
    public static void main(String[] args) {
        Random random=new Random();
        ArrayList<IWomen> women=new ArrayList<>();

        for (int i=0;i<5;i++){
            women.add(new Women(random.nextInt(3)+1,"我要出去逛街"));
        }
        Handler father =new Father();
        Handler husband =new Husband();
        Handler son =new Son();

        father.setNext(husband);
        husband.setNext(son);

        for (IWomen women1:women){
            father.handleMessage(women1);
        }
    }
}
